package edu.hubu.talentmanagementsystem.model.ext;


import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import edu.hubu.talentmanagementsystem.common.SensitiveField;
import edu.hubu.talentmanagementsystem.model.Model;

import java.io.Serializable;

/**
 * <p>
 * 系统管理员
 * </p>
 *
 * @author moonlan
 * @since 2021-03-13
 */
@TableName("admin")
public class Admin extends Model<Admin> implements Serializable {


    /**
     * 系统管理员ID
     */
    @TableId(value = "admin_id", type = IdType.AUTO)
    private Integer adminId;

    /**
     * 系统管理员编号
     */
    @TableField("admin_num")
    private String adminNum;

    /**
     * 系统管理员密码
     */
    @TableField("admin_pwd")
    @SensitiveField
    private String adminPwd;

    /**
     * 系统管理员角色
     */
    @TableField("admin_role_id")
    private Integer adminRoleId;

    @TableField(exist = false)
    private Role role;

    public Role getRole() {
        return role;
    }

    public Admin setRole(Role role) {
        this.role = role;
        return this;
    }

    public Integer getAdminId() {
        return adminId;
    }

    public Admin setAdminId(Integer adminId) {
        this.adminId = adminId;
        return this;
    }

    public String getAdminNum() {
        return adminNum;
    }

    public Admin setAdminNum(String adminNum) {
        this.adminNum = adminNum;
        return this;
    }

    @SensitiveField
    public String getAdminPwd() {
        return adminPwd;
    }

    public Admin setAdminPwd(String adminPwd) {
        this.adminPwd = adminPwd;
        return this;
    }

    public Integer getAdminRoleId() {
        return adminRoleId;
    }

    public Admin setAdminRoleId(Integer adminRoleId) {
        this.adminRoleId = adminRoleId;
        return this;
    }

    @Override
    public String toString() {
        return "Admin{" +
                "adminId=" + adminId +
                ", adminNum=" + adminNum +
                ", adminPwd=" + adminPwd +
                ", adminRoleId=" + adminRoleId +
                "}";
    }
}
